package com.cyf.db.mapper;

import com.cyf.db.bean.VisitorImg;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * Created by hfy on 2018/3/13.
 */
public interface VisitorImgMapper {

    @Insert("insert into visitor_img(visitorRecordId, img) values(#{visitorRecordId}, #{img})")
    void insertImg(@Param("visitorRecordId") int visitorRecordId, @Param("img") byte[] img);

    @Select("select id from visitor_img where visitorRecordId = #{visitorRecordId}")
    Integer getIdByVisitorRecordId(@Param("visitorRecordId") int visitorRecordId);

    @Select("select * from visitor_img where id = #{id}")
    VisitorImg getById(@Param("id") Integer id);
}
